//
//  ZGSHotDetailsViewController.m
//  Tour
//
//  Created by dllo on 15/10/28.
//  Copyright (c) 2015年 蓝鸥科技. All rights reserved.
//

#import "ZGSHotDetailsViewController.h"
#import "AdvanceEdit.h"
#import "UMSocial.h"

@interface ZGSHotDetailsViewController ()

@end

@implementation ZGSHotDetailsViewController
//@property (nonatomic, retain)NSString *name;
//@property (nonatomic, retain)NSString *introduce;//介绍
//@property (nonatomic, retain)NSString *outline;//概览
//@property (nonatomic, retain)NSString *address;
//@property (nonatomic, retain)NSString *goWay;
//@property (nonatomic, retain)NSString *openTime;
//@property (nonatomic, retain)NSString *phone;
//@property (nonatomic, retain)NSString *imageHead;
//@property (nonatomic, retain)NSString *titleHead;


- (void)dealloc{
    [_name release];
    [_introduce release];
    [_outline release];
    [_address release];
    [_goWay release];
    [_openTime release];
    [_phone release];
    [_imageHead release];
    [_titleHead release];
    [super dealloc];
    //super dealloc viewwillappear anmaten navigationcontroller navigationbar.translucent
}
- (void)viewWillAppear:(BOOL)animated{
    self.navigationController.hidesBarsOnSwipe = NO;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    self.navigationController.navigationBar.translucent = NO;
    self.title = self.name;

    UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, WIDTH, HEIGHT)];
    scrollView.contentSize = CGSizeMake(0, HEIGHT + 200);
    [self.view addSubview:scrollView];
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"分享" style:UIBarButtonItemStylePlain target:self action:@selector(clickCollect:)];
    
    
    UIImageView *imageHead = [[UIImageView alloc] init];
    imageHead.frame = CGRectMake(0, 0, WIDTH, HEIGHT / 3);
    [imageHead sd_setImageWithURL:[NSURL URLWithString:self.imageHead] placeholderImage:[UIImage imageNamed:@"10.jpeg"]];
    [scrollView addSubview:imageHead];
    [imageHead release];
    
    UILabel *labelName = [[UILabel alloc] initWithFrame:CGRectMake(WIDTH / 3.5 - 20, HEIGHT / 3 + 64 + 10, WIDTH / 3.5 * 2, 50)];
    labelName.font = [UIFont systemFontOfSize:24];
    labelName.text = self.name;
    [scrollView addSubview:labelName];
    [labelName release];
    
    UILabel *labelIntroduce = [[UILabel alloc] initWithFrame:CGRectMake(self.view.center.x, HEIGHT / 3 + 64 + 10 + 50, WIDTH / 3.5 * 2, 50)];
    labelIntroduce.text = self.introduce;
    labelIntroduce.numberOfLines = 2;
    labelIntroduce.font = [UIFont systemFontOfSize:10];
    [scrollView addSubview:labelIntroduce];
    [labelIntroduce release];
    
    
    
    UILabel *labelInformation = [[UILabel alloc] initWithFrame:CGRectMake(self.view.center.x - 30, HEIGHT / 3 + 64 + 10 + 100 + 10, 60, 20)];
    labelInformation.text = @"基本信息";
    labelInformation.font = [UIFont systemFontOfSize:12];
    [scrollView addSubview:labelInformation];
    [labelInformation release];
    
    
    //概况
    UILabel *labelOutline = [[UILabel alloc] initWithFrame:CGRectMake(5, HEIGHT / 3 + 174 + 20 + 20, WIDTH - 10, 80)];
    labelOutline.numberOfLines = 4;
    labelOutline.font = [UIFont systemFontOfSize:10];
    labelOutline.text = self.outline;
    [scrollView addSubview:labelOutline];
    [labelOutline release];
//    labelOutline.layer.borderWidth = 1;
    
    UILabel *labelAddress = [[UILabel alloc] initWithFrame:CGRectMake(5, HEIGHT / 3 + 214 + 130, WIDTH - 10, 20)];
    labelAddress.font = [UIFont systemFontOfSize:10];
    labelAddress.text = self.address;
    [scrollView addSubview:labelAddress];
    [labelAddress release];
    //到达方式
    UILabel *labelGoWay = [[UILabel alloc] initWithFrame:CGRectMake(5, HEIGHT / 3 + 214 + 180, WIDTH - 10, 80)];
    labelGoWay.font = [UIFont systemFontOfSize:10];
    labelGoWay.text = self.goWay;
    labelGoWay.numberOfLines = 4;
    [scrollView addSubview:labelGoWay];
    [labelGoWay release];
    
    //联系
    
    UILabel *labelPhone = [[UILabel alloc] initWithFrame:CGRectMake(5, HEIGHT / 3 + 394 + 100, WIDTH - 10, 20)];
    labelPhone.text = self.phone;
    labelPhone.font = [UIFont systemFontOfSize:10];
    [scrollView addSubview:labelPhone];
    [labelPhone release];
//    self.navigationController.navigationBar.frame.size.height
    scrollView.contentSize = CGSizeMake(0, HEIGHT / 3 + 394 + 100 +50  +self.navigationController.navigationBar.frame.size.height
);

    
    
    
    
    
    
//    [self.view addSubview:imageHead];
}

- (void)clickCollect:(UIBarButtonItem *)button{
    [UMSocialSnsService presentSnsIconSheetView:self appKey:@"5632bfafe0f55a7d78002859"shareText:@"你要分享的文字"
                                     shareImage:[UIImage imageNamed:@"icon.png"]
                                shareToSnsNames:[NSArray arrayWithObjects:UMShareToSina,UMShareToTencent,UMShareToRenren,UMShareToDouban,UMShareToTwitter,UMShareToQzone,UMShareToEmail, UMShareToSms,UMShareToFacebook, nil]
                                       delegate:nil];
    
}

- (void)click:(UIButton *)button {
    [self.navigationController popToRootViewControllerAnimated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
